Method and system for approximating curve, and graphic display control method and apparatus

ABSTRACT

A method and system for approximating a curve, and a graphic display control method and apparatus are disclosed. The method for approximating a curve comprises the steps of acquiring number information of subdividing points for subdividing a curve needed to be approximated based on coordinate information of control points of the curve, acquiring coordinate information of the subdividing points based on the number information of the subdividing points and the coordinate information of the control points, and connecting the subdividing points with straight lines based on the coordinate information of the subdividing points. The invention could achieve efficient curve approximation and in turn achieve efficient graphic-display control.

TECHNICAL FIELD

The invention relates to graphic processing, and particularly relates toa method and apparatus for approximating a curve and a graphic displaycontrol method and apparatus.

BACKGROUND

In computer graphics applications, rendering characters is an importantbranch. Two-dimensional characters are generally formed by quadraticBezier curves, cubic Bezier curves, and elliptical curves etc., in atwo-dimensional plane.

It is inefficient, for a Graphics Display Controller (GDC) chip, torender curves pixel by pixel by tracking along the curves. Withappropriate precision, it is reasonable to approximate a curve withstraight lines. It is a tradeoff between precision and speed. For manyapplications of GDC chips, speed overwhelms precision, such as carnavigation, mobile phone, and amusement displayer.

Approximating a curve with straight lines needs to firstly subdivide thecurve with subdividing points, then calculate coordinates of thesubdividing points, and finally connect adjacent subdividing points viastraight lines. It is a long existing problem to approximate a curve.There exist many solutions to approximate Bezier curves, such as directmethod, recursive subdivision, forward differencing, and hybrid method.However, these methods are not fast enough.

As Bezier curves are commonly represented by polynomials of parameter t(for example, x(t)=a·t²+b·t+c, y(t)=d·t²+e·t+f for quadratic Beziercurve, where the coefficients a, b, c, d, e, and f can be calculated bycontrol points of the quadratic Bezier curve), the coordinate values ofeach subdividing point can be calculated directly, given the parameter tat each subdividing point. Although this method is simple and direct, itneeds too many multiplications for each subdividing point.

Recursive subdivision is a recursive procedure, to find step by stepsubdividing points by calculating the middle points on each edge of acontrol polygon. Connecting adjacent subdividing points will formstraight lines. Setting an appropriate threshold of flatness, thestraight lines will approximate a curve with reasonable precision.However, the recursive procedure and calculating flatness will take alarge amount of time.

Forward differencing is suitable for Bezier curves. The coordinatevalues of a next subdividing point can be got by adding the coordinatevalues of a previous subdividing point with difference values. With afixed step, the coordinate values of each subdividing point can becalculated by just several addition operations. Therefore, the speed isvery high. However, the number of the subdividing points (i.e. the step)needs to be determined before calculating the coordinates.

The hybrid method combines recursive subdivision and forwarddifferencing together. It first uses recursive subdivision and flatnessto obtains the parameter of each subdividing point, and then usesforward differencing to calculate the coordinate values of eachsubdividing point. This method is complex for implementation.

Therefore, a method and/or apparatus for approximating a curve, used incurve rendering and more efficient than the abovementioned methods, areneeded.

SUMMARY OF THE INVENTION

In view of one or more of the above problems, this invention proposes amethod and apparatus for approximating a curve and a graphic-displaycontrol method and apparatus.

The method for approximating a curve according to an aspect of theinvention, comprising the steps of: acquiring number information ofsubdividing points for subdividing a curve needed to be approximatedbased on coordinate information of control points of the curve;acquiring coordinate information of the subdividing points based on thenumber information of the subdividing points and the coordinateinformation of the control points; and connecting the subdividing pointswith straight lines based on the coordinate information of thesubdividing points.

The apparatus for approximating a curve according to another aspect ofthe invention, comprising: a number acquiring unit configured to acquirenumber information of subdividing points for subdividing a curve neededto be approximated based on coordinate information of control points ofthe curve; a coordinate acquiring unit configured to acquire coordinateinformation of the subdividing points based on the number information ofthe subdividing points and the coordinate information of the controlpoints; and a curve approximating unit configured to connect thesubdividing points with straight lines based on the coordinateinformation of the subdividing points.

The graphic-display control method according to still another aspect ofthe invention, comprising the steps of: acquiring number information ofsubdividing points for subdividing a curve needed to be approximatedbased on coordinate information of control points of the curve;acquiring coordinate information of the subdividing points based on thenumber information of the subdividing points and the coordinateinformation of the control points; and connecting the subdividing pointswith straight lines based on the coordinate information of thesubdividing points and drawing the straight lines connecting thesubdividing points according to rendering parameters.

The graphic-display control apparatus according to still another aspectof the invention, comprising: a number acquiring unit configured toacquire number information of subdividing points for subdividing a curveneeded to be approximated based on coordinate information of controlpoints of the curve; a coordinate acquiring unit configured to acquirecoordinate information of the subdividing points based on the numberinformation of the subdividing points and the coordinate information ofthe control points; and a curve rendering unit configured to connect thesubdividing points with straight lines based on the coordinateinformation of the subdividing points and draw the straight linesconnecting the subdividing points according to rendering parameters.

To sum up, the invention achieves efficient curve approximation andefficient graphic-display control by acquiring the number information ofthe subdividing points for subdividing a curve by means of using thecoordinate information of the control points of the curve, acquiring thecoordinate information of the subdividing points according to the numberinformation of the subdividing points and the coordinate information ofthe control points.

BRIEF DESCRIPTION OF THE DRAWINGS

The invention can be easily understood from the following description ofthe preferred embodiments of this invention in conjunction with thedrawings, in which

FIG. 1 illustrates schematic diagrams of a quadratic Bezier curve, acubic Bezier curve and an elliptical curve;

FIG. 2 illustrates schematic diagram of a relationship between an areadifference and a subdividing step, wherein the area difference is thedifference between the area of a curve segment corresponding to thesubdividing step with respect to X coordinate axis and the area of aline segment of two points corresponding to the subdividing step on thecurve with respect to X coordinate axis;

FIG. 3 illustrates a conceptual schematic diagram of forwarddifferencing for approximating a Bezier curve;

FIG. 4 illustrates a schematic diagram of the procedure for affinetransforming a unit circle to acquire an ellipse;

FIG. 5 illustrates a block diagram of a graphic-display controlapparatus according to an embodiment of the invention;

FIG. 6 illustrates a detailed block diagram of a subdivision moduleshown in FIG. 5; and

FIG. 7 illustrates a detailed block diagram of a coordinate calculationmodule shown in FIG. 5.

DESCRIPTIONS OF THE PREFERRED EMBODIMENTS

Features in respective aspects and exemplary embodiments of theinvention will be described in detail below. In the following detaileddescription, a number of specific details are proposed to providethorough understanding of the invention. However, it is obvious to thoseskilled in the art that the invention can be implemented without some ofthe specific details. The following descriptions of the embodiments aremerely to provide better understanding of the invention by illustratingexamples of the invention. The invention is not limited to any specificconfiguration and algorithm mentioned below, and covers anymodification, substitution and improvement of the elements, componentsand algorithms without departing from the spirit of the invention. Inthe figures and the following description, well-known structures andtechniques are not disclosed to avoid unnecessarily obscuring theinvention.

FIG. 1 illustrates diagrams of a quadratic Bezier curve, a cubic Beziercurve and an elliptical curve. As shown in FIG. 1, the quadratic Beziercurve 102 has three control points: P₀(x₀, y₀), P₁(x₁, y₁) and P₂ (x₂y₂); the cubic Bezier curve 104 has four control points: P₀(x₀, y₀),P₁(x₁, y₁), P₂ (x₂,y₂) and P₃ (x₃,y₃). These control points constitute acontrol polygon for each curve respectively. The elliptical curve 106has a horizontal radius rh, a vertical radius rv, a starting angle θ₀, aterminating angle θ₁, a center point P_(c)(x_(c), y_(c)), a rotationangle rot and a symbol indicating whether the elliptical curve rotatescounterclockwise (CCW) or clockwise (CW).

The parametrical equation of the quadratic Bezier curve is

x(t)=(1−t)² x ₀+2t(1−t)x ₁ +t ² x ₂

y(t)=(1−t)² y ₀+2t(1−t)y ₁ +t ² y ₂  (1)

where 0≦t≦1. The parametrical equation of the quadratic Bezier curve canbe set as another form:

x(t)=a _(qx) t ² +b _(qx) t+c _(qx)

y(t)=a _(qy) t ² +b _(qy) t+c _(qy)  (2)

where a_(qx)=x₂−2x₁+x₀, b_(qx)=2(x₁−x₀), c_(qx)=x₀, a_(qy)=y₂−2y₁+y₀,b_(qy)=2(y₁−y₀), and c_(qy)=y₀.

The parametrical equation of the cubic Bezier curve is

x(t)=(1−t)³ x ₀+3t(1−t)² x ₁+3t ²(1−t)x ₂ +t ³ x ₃

y(t)=(1−t)³ y ₀+3t(1−t)² y ₁+3t ²(1−t)y ₂ +t ³ y ₃  (3)

where 0≦t≦1. The parametrical equations of the cubic Bezier curve canalso be set as another form:

x(t)=a _(cx) t ³ +b _(cx) t ² +c _(cx) t+d _(cx)

y(t)=a _(cy) t ³ +b _(cy) t ² +c _(cy) t+d _(cy)  (4)

wherein a_(cx)=x₃−3x₂+3x₁−x₀, b_(cx)=3x₂−6x₁+3x₀, c_(cx)=3x₁−3x₀,d_(cx)=x₀, a_(cy)=y₃−3y₂+3y₁−y₀, b_(cy)=3y₂−6y₁+3y₀, c_(cy),=3y₁−3y₀ andd_(cy)=y₀.

The parametrical equation of the elliptical curve is

$\begin{matrix}{{\begin{bmatrix}x \\y \\1\end{bmatrix} = {\begin{bmatrix}{{rh} \cdot {\cos ({rot})}} & {{- {rv}} \cdot {\sin ({rot})}} & x_{c} \\{{rh} \cdot {\sin ({rot})}} & {{rv} \cdot {\cos ({rot})}} & y_{c} \\0 & 0 & 1\end{bmatrix}\begin{bmatrix}{\cos \; \theta} \\{\sin \; \theta} \\1\end{bmatrix}}},} & (5)\end{matrix}$

where θ is the parameter of any point on the elliptical curve, and rotis the rotation angle of the elliptical curve relative to the coordinatesystem. The elliptical curve can be regarded as a result of affinetransforming a unit circle (cos θ, sin θ).

FIG. 2 illustrates a schematic diagram of a relationship between an areadifference and a subdividing step, wherein the area difference is thedifference between the area of a curve segment corresponding to thesubdividing step with respect to X coordinate axis and the area of aline segment of two points corresponding to the subdividing step on thecurve with respect to X coordinate axis.

The area difference ΔA between the area of a curve segment correspondingto a subdividing step Δt with respect to X coordinate axis and the areaof a line segment between two points corresponding to the subdividingstep on the curve with respect to X coordinate axis can be obtained bythe following expression:

ΔA=A−A _(a),  (6)

where A is the area of the curve segment corresponding to Δt withrespect to X coordinate axis, and A_(a) is the area of the line segmentbetween two end points on the curve segment with respect to X coordinateaxis.

If the curve segment is part of the quadratic Bezier curve, then thereexist the following equations

$\begin{matrix}\begin{matrix}{A = {\int_{t}^{t + {\Delta \; t}}{{y(t)}\ {{x(t)}}}}} \\{= {\int_{t}^{t + {\Delta \; t}}{\left( {{a_{qy}t^{2}} + {b_{qy}t} + c_{qy}} \right)\left( {{2a_{qx}t} + b_{qx}} \right){t}}}} \\{= {{\frac{a_{qx}a_{qy}}{2}\Delta \; t^{4}} + {\left( {{2a_{qx}a_{qy}t} + \frac{{a_{qy}b_{qx}} + {2a_{qx}b_{qy}}}{3}} \right)\Delta \; t^{3}} +}} \\{{{\begin{pmatrix}{{3a_{qx}a_{qy}t^{2}} +} \\{{\left( {{a_{qy}b_{qx}} + {2a_{qx}b_{qy}}} \right)t} +} \\\frac{{b_{qx}b_{qy}} + {2a_{qx}c_{qy}}}{2}\end{pmatrix}\Delta \; t^{2}} + {\begin{pmatrix}{{2a_{qx}a_{qy}t^{3}} +} \\{{\left( {{a_{qy}b_{qx}} + {2a_{qx}b_{qy}}} \right)t^{2}} +} \\{{\left( {{b_{qx}b_{qy}} + {2a_{qx}c_{qy}}} \right)t} +} \\{b_{qx}c_{qy}}\end{pmatrix}\Delta \; t}}}\end{matrix} & (7) \\{and} & \; \\\begin{matrix}{A_{a} = \frac{\left( {{y(t)} + {y\left( \; {t + {\Delta \; t}} \right)}} \right) \cdot \left( {{x\left( \; {t + {\Delta \; t}} \right)} - {x(t)}} \right)}{2}} \\{= {\frac{1}{2}{\begin{pmatrix}{{a_{qy}t^{2}} + {b_{qy}t} + c_{qy} + {a_{qy}\left( \; {t + {\Delta \; t}} \right)}^{2} +} \\{{b_{qy}\left( \; {t + {\Delta \; t}} \right)} + c_{qy}}\end{pmatrix} \cdot}}} \\{\left( {{a_{qx}\left( {{\Delta \; t^{2}} + {2{t \cdot \Delta}\; t}} \right)} + {b_{qx}\Delta \; t}} \right)} \\{= {{\frac{a_{qx}a_{qy}}{2}\Delta \; t^{4}} + {\left( {{2a_{qx}a_{qy}t} + \frac{{a_{qy}b_{qx}} + {a_{qx}b_{qy}}}{2}} \right)\Delta \; t^{3}} +}} \\{{{\begin{pmatrix}{{3a_{qx}a_{qy}t^{2}} +} \\{{\left( {{a_{qy}b_{qx}} + {2a_{qx}b_{qy}}} \right)t} +} \\\frac{{b_{qx}b_{qy}} + {2a_{qx}c_{qy}}}{2}\end{pmatrix}\Delta \; t^{2}} + {\begin{pmatrix}{{2a_{qx}a_{qy}t^{3}} +} \\{{\left( {{a_{qy}b_{qx}} + {2a_{qx}b_{qy}}} \right)t^{2}} +} \\{{\left( {{b_{qx}b_{qy}} + {2a_{qx}c_{qy}}} \right)t} +} \\{b_{qx}c_{qy}}\end{pmatrix}\Delta \; t}}}\end{matrix} & (8)\end{matrix}$

Therefore, the area difference between the area of the curve segmentcorresponding to Δt with respect to X coordinate axis and the area ofthe line segment between the two points on the curve segmentcorresponding to the subdividing step with respect to X coordinate axisis

$\begin{matrix}\begin{matrix}{{\Delta \; A} = {A - A_{a}}} \\{= {\left( {\frac{{a_{qy}b_{qx}} + {2a_{qx}b_{qy}}}{3} - \frac{{a_{qy}b_{qx}} + {a_{qx}b_{qy}}}{2}} \right)\Delta \; t^{3}}} \\{= {\frac{{a_{qx}b_{qy}} - {a_{qy}b_{qx}}}{6}\Delta \; t^{3}}} \\{= {{Q \cdot \Delta}\; t^{3}}}\end{matrix} & (9)\end{matrix}$

As can be seen from the above expression, the area difference has norelationship with the parameter t, but with Δt. If ΔA is set to athreshold T, (5 pixels, for example), Δt can be obtained by thefollowing expression:

$\begin{matrix}{{\Delta \; t} = {\sqrt[3]{\frac{T}{Q}}.}} & (10)\end{matrix}$

If the curve segment is part of the cubic Bezier curve, then there existthe following equations:

$\begin{matrix}\begin{matrix}{A = {\int_{t}^{t + {\Delta \; t}}{{y(t)}\ {{x(t)}}}}} \\{= {\int_{t}^{t + {\Delta \; t}}{\left( {{a_{cy}t^{3}} + {b_{cy}t^{2}} + {c_{cy}t} + d_{cy}} \right)\left( {{3a_{cx}t^{2}} + {2b_{cx}t} + c_{cx}} \right){t}}}} \\{= {{\frac{a_{cx}a_{cy}}{2}\Delta \; t^{6}} + {\left( {{3a_{cx}a_{cy}t} + \frac{{3a_{cx}b_{cy}} + {2a_{cy}b_{cx}}}{5}} \right)\Delta \; t^{5}} +}} \\{{{\left( {{\frac{15a_{cx}a_{cy}}{2}t^{2}} + {\begin{pmatrix}{{2a_{cy}b_{cx}} +} \\{3a_{cx}b_{cy}}\end{pmatrix}t} + \left( \frac{\begin{matrix}{{a_{cy}c_{cx}} +} \\{{2b_{cx}b_{cy}} +} \\{3a_{cx}c_{cy}}\end{matrix}}{4} \right)} \right)\Delta \; t^{4}} +}} \\{{{\begin{pmatrix}{{10a_{cx}a_{cy}t^{3}} + {\begin{pmatrix}{{4a_{cy}b_{cx}} +} \\{6a_{cx}b_{cy}}\end{pmatrix}t^{2}} + {\begin{pmatrix}{{a_{cy}c_{cx}} +} \\{{2b_{cx}b_{cy}} +} \\{3a_{cx}c_{cy}}\end{pmatrix}t} +} \\\frac{{b_{cy}c_{cx}} + {2b_{cx}c_{cy}} + {3a_{cx}d_{cy}}}{3}\end{pmatrix}\Delta \; t^{3}} +}} \\{{{\begin{pmatrix}{{\frac{15a_{cx}a_{cy}}{2}t^{4}} + {\begin{pmatrix}{{4a_{cy}b_{cx}} +} \\{6a_{cx}b_{cy}}\end{pmatrix}t^{3}} + {\left( \frac{\begin{matrix}{{3a_{cy}c_{cx}} +} \\{{6b_{cx}b_{cy}} +} \\{9a_{cx}c_{cy}}\end{matrix}}{2} \right)t^{2}} +} \\{{\begin{pmatrix}{{b_{cy}c_{cx}} +} \\{{2b_{cx}c_{cy}} +} \\{3a_{cx}d_{cy}}\end{pmatrix}t} + \frac{{c_{cx}c_{cy}} + {2b_{cx}d_{cy}}}{2}}\end{pmatrix}\Delta \; t^{2}} +}} \\{{\begin{pmatrix}{{3a_{cx}a_{cy}t^{5}} + {\begin{pmatrix}{{2a_{cy}b_{cx}} +} \\{3a_{cx}b_{cy}}\end{pmatrix}t^{4}} + {\begin{pmatrix}{{a_{cy}c_{cx}} +} \\{{2b_{cx}b_{cy}} +} \\{3a_{cx}c_{cy}}\end{pmatrix}t^{3}} +} \\{{\begin{pmatrix}{{b_{cy}c_{cx}} +} \\{{2b_{cx}c_{cy}} +} \\{3a_{cx}d_{cy}}\end{pmatrix}t^{2}} + {\left( {{c_{cx}c_{cy}} + {2b_{cx}d_{cy}}} \right)t} + {c_{cx}d_{cy}}}\end{pmatrix}\Delta \; t}}\end{matrix} & (11) \\{and} & \; \\\begin{matrix}{A_{a} = \frac{\left( {{y(t)} + {y\left( \; {t + {\Delta \; t}} \right)}} \right) \cdot \left( {{x\left( \; {t + {\Delta \; t}} \right)} - {x(t)}} \right)}{2}} \\{= {\frac{1}{2}{\begin{pmatrix}{{a_{cy}t^{3}} + {b_{cy}t^{2}} + {c_{cy}t} + d_{cy} + {a_{cy}\left( \; {t + {\Delta \; t}} \right)}^{3} +} \\{{b_{cy}\left( \; {t + {\Delta \; t}} \right)}^{2} + {c_{cy}\left( \; {t + {\Delta \; t}} \right)} + d_{cy}}\end{pmatrix} \cdot}}} \\{\left( {{a_{cx}\left( {{\Delta \; t^{3}} + {3{t \cdot \Delta}\; t^{2}} + {3\; {t^{2} \cdot \Delta}\; t}} \right)} + {b_{cx}\left( {{\Delta \; t^{2}} + {2{t \cdot \Delta}\; t}} \right)} + {c_{cx}\Delta \; t}} \right)} \\{= {{\frac{a_{cx}a_{cy}}{2}\Delta \; t^{6}} + {\left( {{3a_{cx}a_{cy}t} + \frac{{a_{cx}b_{cy}} + {a_{cy}b_{cx}}}{2}} \right)\Delta \; t^{5}} +}} \\{{{\begin{pmatrix}{{\frac{15a_{cx}a_{cy}}{2}t^{2}} +} \\{{\frac{{5a_{cy}b_{cx}} + {5a_{cx}b_{cy}}}{2}t} +} \\\frac{{a_{cy}c_{cx}} + {b_{cx}b_{cy}} + {a_{cx}c_{cy}}}{2}\end{pmatrix}\Delta \; t^{4}} +}} \\{{{\begin{pmatrix}{{10a_{cx}a_{cy}t^{3}} + {\frac{{9a_{cy}b_{cx}} + {11a_{cx}b_{cy}}}{2}t^{2}} +} \\{{\frac{{5a_{cx}c_{cy}} + {4b_{cx}b_{cy}} + {3a_{cy}c_{cx}}}{2}t} +} \\\frac{{b_{cy}c_{cx}} + {b_{cx}c_{cy}} + {2a_{cx}d_{cy}}}{2}\end{pmatrix}\Delta \; t^{3}} +}} \\{{{\begin{pmatrix}{{\frac{15a_{cx}a_{cy}}{2}t^{4}} + {\left( {{4a_{cy}b_{cx}} + {6a_{cx}b_{cy}}} \right)t^{3}} +} \\{{\frac{{3a_{cy}c_{cx}} + {6b_{cx}b_{cy}} + {9a_{cx}c_{cy}}}{2}t^{2}} +} \\{{\left( {{b_{cy}c_{cx}} + {2b_{cx}c_{cy}} + {3a_{cx}d_{cy}}} \right)t} +} \\\frac{{c_{cx}c_{cy}} + {2b_{cx}d_{cy}}}{2}\end{pmatrix}\Delta \; t^{2}} +}} \\{{\begin{pmatrix}{{3a_{cx}a_{cy}t^{5}} + {\left( {{2a_{cy}b_{cx}} + {3a_{cx}b_{cy}}} \right)t^{4}} +} \\{{\left( {{a_{cy}c_{cx}} + {2b_{cx}b_{cy}} + {3a_{cx}c_{cy}}} \right)t^{3}} +} \\{{\left( {{b_{cy}c_{cx}} + {2b_{cx}c_{cy}} + {3a_{cx}d_{cy}}} \right)t^{2}} +} \\{{\left( {{c_{cx}c_{cy}} + {2b_{cx}d_{cy}}} \right)t} + {c_{cx}d_{cy}}}\end{pmatrix}\Delta \; t}}\end{matrix} & (12) \\{{Then},} & \; \\\begin{matrix}{{\Delta \; A} = {A - A_{a}}} \\{= {{\left( \frac{{a_{cx}b_{cy}} - {a_{cy}b_{cx}}}{10} \right)\Delta \; t^{5}} + {\begin{pmatrix}{{\frac{{a_{cx}b_{cy}} - {a_{cy}b_{cx}}}{2}t} +} \\\frac{{a_{cx}c_{cy}} - {a_{cy}c_{cx}}}{4}\end{pmatrix}\Delta \; t^{4}} +}} \\{{\begin{pmatrix}{{\frac{{a_{cx}b_{cy}} - {a_{cy}b_{cx}}}{2}t^{2}} +} \\{{\frac{{a_{cx}c_{cy}} - {a_{cy}c_{cx}}}{2}t} +} \\\frac{{b_{cx}c_{cy}} - {b_{cy}c_{cx}}}{6}\end{pmatrix}\Delta \; t^{3}}}\end{matrix} & (13)\end{matrix}$

As Δt is between (0,1] under general conditions, two items Δt⁵

Δt⁴ can be omitted, then the above mentioned equation (13) becomes

$\begin{matrix}\begin{matrix}{{\Delta \; A} \approx {\begin{pmatrix}{{\frac{{a_{cx}b_{cy}} - {a_{cy}b_{cx}}}{2}t^{2}} +} \\{{\frac{{a_{cx}c_{cy}} - {a_{cy}c_{cx}}}{2}t} + \frac{{b_{cx}c_{cy}} - {b_{cy}c_{cx}}}{6}}\end{pmatrix}\Delta \; t^{3}}} \\{= {{{C(t)} \cdot \Delta}\; {t^{3}.}}}\end{matrix} & (14)\end{matrix}$

If the maximum value of

$\begin{matrix}\begin{matrix}{{C(t)} = {{\frac{{a_{cx}b_{cy}} - {a_{cy}b_{cx}}}{2}t^{2}} + {\frac{{a_{cx}c_{cy}} - {a_{cy}c_{cx}}}{2}t} + \frac{{b_{cx}c_{cy}} - {b_{cy}c_{cx}}}{6}}} \\{= {{L \cdot t^{2}} + {M \cdot t} + N}}\end{matrix} & \;\end{matrix}$

can be obtained, then the abovementioned equation (14) will be

ΔA≈C _(max) ·Δt ³  (15)

As in general cases, the scope of t is [0.0,1.0], to find the maximumvalue of C(t) is to find the maximum value of among t=0.0, t=1.0 and

$t = {- {\frac{M}{2L}.}}$

These three values are

$\begin{matrix}{{{val}_{t = 0} = \frac{{b_{x}c_{y}} - {b_{y}c_{x}}}{6}}{{val}_{t = 1} = {\frac{{a_{x}b_{y}} - {a_{y}b_{x}}}{2} + \frac{{a_{x}c_{y}} - {a_{y}c_{x}}}{2} + \frac{{b_{x}c_{y}} - {b_{y}c_{x}}}{6}}}{{val}_{t = {{- M}/{({2L})}}} = {{- \frac{M^{2}}{4L}} + N}}} & (16)\end{matrix}$

Therefore,

C _(max)=max(val_(t=0),val_(t=1),val_(t=−M/(2L)))  (17)

Finally, if ΔA is set to a threshold T (5 pixels, for example), then thefollowing expression will be gotten:

$\begin{matrix}{{\Delta \; t} = \sqrt[3]{\frac{T}{C_{\max}}}} & (18)\end{matrix}$

If the curve segment is part of the elliptical curve, which is centeredat the original point of the coordinate system, and has no rotationrelative to X coordinate axis, then there exist the following equations:

$\begin{matrix}\begin{matrix}{A = {\int_{t}^{t + {\Delta \; t}}{{y(t)}\ {{x(t)}}}}} \\{= {\int_{t}^{t + {\Delta \; t}}{\left( {{rv}\; \sin \; t} \right)\left( {{- {rh}}\; \sin \; t} \right){t}}}} \\{= {\frac{{rh} \cdot {rv}}{2}\begin{pmatrix}{{{\sin\left( \; {t + {\Delta \; t}} \right)}{\cos\left( \; {t + {\Delta \; t}} \right)}} -} \\{{\sin \; t\; \cos \; t} - {\Delta \; t}}\end{pmatrix}}}\end{matrix} & (19) \\{and} & \; \\\begin{matrix}{A_{a} = \frac{\left( {{y(t)} + {y\left( \; {t + {\Delta \; t}} \right)}} \right) \cdot \left( {{x\left( \; {t + {\Delta \; t}} \right)} - {x(t)}} \right)}{2}} \\{= \frac{\left( {{{rv}\; \sin \; t} + {{rv}\; {\sin\left( \; {t + {\Delta \; t}} \right)}}} \right) \cdot \left( {{{rh}\; {\cos\left( \; {t + {\Delta \; t}} \right)}} - {{rh}\; \cos \; t}} \right)}{2}} \\{= {\frac{{rh} \cdot {rv}}{2}\begin{pmatrix}{{\sin \; t\; {\cos\left( \; {t + {\Delta \; t}} \right)}} - \; {\sin \; t\; \cos \; t} +} \\{{{\sin\left( \; {t + {\Delta \; t}} \right)}{\cos\left( \; {t + {\Delta \; t}} \right)}} - {{\sin\left( \; {t + {\Delta \; t}} \right)}\cos \; t}}\end{pmatrix}}}\end{matrix} & (20) \\{Then} & \; \\\begin{matrix}{{\Delta \; A} = {A - A_{a}}} \\{= {\frac{{rh} \cdot {rv}}{2}\left( {{\sin \; \Delta \; t} - {\Delta \; t}} \right)}}\end{matrix} & (21)\end{matrix}$

The absolute value of ΔA is

$\begin{matrix}\begin{matrix}{{{\Delta \; A}} = {\frac{{rh} \cdot {rv}}{2}\left( {{\Delta \; t} - {\sin \; \Delta \; t}} \right)}} \\{= {\frac{{rh} \cdot {rv}}{2}\left( {{\Delta \; t} - \left( {{\Delta \; t} - \frac{\Delta \; t^{3}}{3!} + \frac{\Delta \; t^{5}}{5!} + \ldots} \right)} \right)}} \\{\approx {\frac{{rh} \cdot {rv}}{2}\frac{\Delta \; t^{3}}{3!}}} \\{= {\frac{{rh} \cdot {rv}}{12}\Delta \; t^{3}}} \\{= {{E \cdot \Delta}\; t^{3}}}\end{matrix} & (22)\end{matrix}$

Finally, if ΔA is set to a threshold T, (5 pixels, for example), then

$\begin{matrix}{{\Delta \; t} = \sqrt[3]{\frac{T}{E}}} & (23)\end{matrix}$

After the subdividing step Δt is obtained, the number of the subdividingpoints can be obtained by the following expression:

n=int(1/Δt)+1  (24)

As the elliptical curve can be obtained by affine transforming a unitcircle curve, coordinate information of the subdividing points can becalculated on the unit circle curve. As the number n of the subdividingpoints has already been obtained and the angle of the circular arc onthe unit circle curve corresponding to the elliptical curve is θ₁−θ₀all, the angle difference between two adjacent subdividing points on thecircular arc of the unit circle is (θ₁−θ₀)/n . From θ₀ to θ₁, thecoordinates of each subdividing point on the circular arc are calculatedaccording to x=cos θ and y=sin θ. Herein, the number of subdividingpoints on the circular arc of the unit circle is the same as that of theelliptical curve.

FIG. 3 illustrates a conceptual schematic diagram of forwarddifferencing for approximating a Bezier curve. For any point P_(t+Δt) onthe curve, the coordinate values can be calculated from the coordinatevalues of the previous point P_(t), given the curve length differenceΔP_(t), as follows:

P _(t+Δt)=P_(t)+ΔP_(t)  (25)

If P_(t+Δt) is treated as parameter equations, then

x(t+Δt)=x(t)+Δx(t)

y(t+Δt)=y(t)+Δy(t)  (26)

If the curve is a quadratic Bezier curve, then

Δx(t)=2(X ₁ −X ₀)Δt·t+(X ₁ −X ₀)Δ² t+2X ₀ Δt

Δy(t)=2(Y ₁ −Y ₀)Δt·t+(Y ₁ −Y ₀)Δ² t+2Y ₀ Δt  (27)

where X₀=x₁−x₀, Y₀=y₁−y₀, X₁=x₂−x₁, and Y₁=y₂−y₁.

Similarly,

Δx(t+Δt)=Δx(t)+Δ² x(t)

Δy(t+Δt)=Δy(t)+Δ² y(t)  (28)

So,

Δ² x(t)=Δ(Δx(t))=2(X ₁ −X ₀)Δ² t

Δ² y(t)=Δ(Δy(t))=2(Y ₁ −Y ₀)Δ² t  (29)

If the curve is defined in iterative terms x_(n+1)=x_(n)+Δx_(n),Δx_(n)=Δx_(n−1)+Δ²x_(n−1), and y_(n+1)=y_(n)+Δy_(n),y_(n+1)=y_(n)+Δy_(n), then x_(n+1) and y_(n+1) can be obtained in aniterative way.

The coordinate values of the first subdividing point, Δx and Δy betweenthe second and first subdividing points can be obtained by substitutingthe value of t on the first subdividing point into the expressions (1)and (27) respectively. Herein, the value of t can be, for example, 0.

If the curve is a cubic Bezier curve, then

Δx(t)=3A _(x) Δt·t ²+3(A _(x)Δ² t+2B _(x) Δt)t+(A _(x)Δ³ t+3B _(x)Δ²t+3C _(x) Δt)

Δy(t)=3A _(y) Δt·t ²+3(A _(y)Δ² t+2B _(y) Δt)t+(A _(y)Δ³ t+3B _(y)Δ²t+3C _(y) Δt)  (30)

where A_(x)=(X₂−X₁)−(X₁−X₀), B_(x)=(X₁−X₀), C_(x)=X₀, X₂=x₃−x₂,A_(y)=(Y₂−Y₁)−(Y₁−Y₀), B_(y)=(Y₁−Y₀), C_(y)=Y₀ and Y₂=y₃−y₂.

Likewise,

Δ² x(t)=Δ(Δx(t))=6A _(x)Δ² t·t+6A _(x)Δ³ t+6B _(x)Δ² t

Δ² y(t)=Δ(Δy(t))=6A _(y)Δ² t·t+6A _(y)Δ³ t+6B _(y)Δ² t  (31)

and

Δ³ x(t)=Δ(Δ² x(t))=6A _(x)Δ³ t

Δ³ y(t)=Δ(Δ² y(t))=6A _(y)Δ³ t  (32)

If the curve is defined in iterative terms x_(n+1)=x_(n)+Δx_(n),Δx_(n)=Δx_(n−1)+Δ²x_(n−1), Δ²x_(n−1)=Δ²x_(n−2)+Δ³x_(n−2), andy_(n+1)=y_(n)+Δy_(n), y_(n+1)=y_(n)+Δy_(n),Δ²y_(n−1)=Δ²y_(n−2)+Δ³y_(n−2), then x_(n+1) and y_(n+1) can becalculated in an iterative way. Likewise, the coordinate values of thefirst subdividing point, Δx and Δy between the second and firstsubdividing points, and Δ²x and Δ²y between the second and firstsubdividing points can be obtained by substituting the value of t on thefirst subdividing point into the expressions (3), (30) and (31)respectively. Herein, the value of t on the first subdividing point canbe, for example, 0.

FIG. 4 illustrates a schematic diagram of the procedure for affinetransforming a unit circle, with translation, rotation and scaling, toacquire an ellipse. The unit circle curve can be defined as(x(θ),y(θ),1)^(T)=(cos θ,sin θ,1)^(T), and the ellipse curve can beobtained by first subdividing the unit circle into points and thenaffine transforming the subdividing points. According to the coordinates(cos θ, sin θ,1)^(T) of the subdividing points on the unit circle arcand the equation (5), the coordinates (x, y,1)^(T) of an ellipse curveafter affine transformation can be obtained through the followingspecific calculating formulas:

x=rh·cos(rot)·cos θ−rv·sin(rot)·sin θ+x _(c)

y=rh·sin(rot)·cos θ+rv·cos(rot)·sin θ+x _(c)  (33)

FIG. 5 illustrates a block diagram of a graphic-display controlapparatus according to an embodiment of the invention. As shown in FIG.5, the graphic-display control apparatus comprises a subdivision module(corresponding to the number acquiring unit) 502, a coordinatecalculation module (corresponding to the coordinate acquiring unit) 504,and a rendering module (corresponding to the curve rendering unit) 506.A curve and rendering parameters are acquired by the graphic-displaycontrol apparatus from outside, and the curve is represented by itscontrol points. Firstly, the subdivision module acquires numberinformation of subdividing points for subdividing a curve by usingcoordinate information of control points of the curve. Secondly, thecoordinate calculation module acquires the coordinate information ofeach subdividing point according to the number information of thesubdividing points and the coordinate information of the control points,by using the method of forward difference when the curve is a Beziercurve or the method of affine transformation when the curve is anellipse curve. Finally the rendering module connects the subdividingpoints by straight lines according to the coordinate information of eachsubdividing point and renders the straight lines connecting respectivesubdividing points by using the rendering parameters.

FIG. 6 illustrates a detailed block diagram of a subdivision moduleshown in FIG. 5. As shown in FIG. 6, the subdividing module calculatescoefficients Q, C_(max) and E in a curve function according to thecoordinate information of the control points of the curve input fromoutside, acquires the relationship between an area difference and asubdividing step based on the curve function, the area difference beingthe difference between the area of a curve segment corresponding to thesubdividing step on the curve with respect to X coordinate axis and thearea of a line segment of two points corresponding to the subdividingstep on the curve with respect to X coordinate axis, calculates thesubdividing step Δt according to the acquired relationship and athreshold input from outside, and calculates the number n of thesubdividing points by using the subdividing step Δt.

FIG. 7 illustrates a detailed block diagram of a coordinate calculationmodule shown in FIG. 5. As shown in FIG. 7, the coordinate calculationmodule calculates the parameter difference Δt according to the number ofthe subdividing points, and calculates the coordinate information of thefirst subdividing point according to coordinate information of thecontrol points. Then it calculates a curve difference ΔP betweenadjacent subdividing points for the Bezier curve, and calculates affinetransformation coefficients for the ellipse curve. By using thedifference value ΔP between adjacent subdividing points, it calculatesthe coordinate values of the subdividing points of the Bezier curve. Byusing the affine transformation coefficients, it affine transforms thesubdividing points on the unit circle to the subdividing points on theellipse curve. Finally, the coordinate values of each subdividing pointare stored in an external memory for the rendering module.

To sum up, the invention acquires the number information of subdividingpoints for subdividing a curve by using coordinate information ofcontrol points of the curve, and then acquires coordinate information ofthe subdividing points according to the number information of thesubdividing points and the coordinate information of the control points,thereby achieving high efficient curve approximation and further highefficient graphic-display control.

What needs to be noted is that respect modules and/or units shown inFIG. 5 can be implemented by using pre-programmed firmware or hardwarecomponent (for example ASIC) or by using data processing devicesincluding EEPROM or other components.

Those skilled in the art will understand that there exist more optionalembodiments and modifications for implementing the embodiments of thisinvention, and the above-mentioned embodiments and examples are onlydescriptions of one or more embodiments. Therefore, the scope of thisinvention is restricted only by the claims attached.

1. A method for approximating a curve, comprising the steps of:acquiring number information of subdividing points for subdividing acurve needed to be approximated based on coordinate information ofcontrol points of the curve; acquiring coordinate information of thesubdividing points based on the number information of the subdividingpoints and the coordinate information of the control points; andconnecting the subdividing points with straight lines based on thecoordinate information of the subdividing points.
 2. The method forapproximating a curve of claim 1, characterized in that the process ofacquiring the number information of the subdividing points comprises thesub-steps of: acquiring a curve function of the curve based on thecoordinate information of the control points; acquiring a relationshipbetween an area difference and a subdividing step based on the curvefunction, wherein the area difference is the difference between the areaof a curve segment corresponding to the subdividing step on the curvewith respect to X coordinate axis and the area of a line segment of twopoints corresponding to the subdividing step on the curve with respectto X coordinate axis; acquiring a subdividing step corresponding to aset area difference based on the relationship between the areadifference and the subdividing step; and acquiring the numberinformation of the subdividing points using the subdividing stepcorresponding to the set area difference.
 3. The method forapproximating a curve of claim 1, characterized in that when the curveis a Bezier curve, the coordinate information of the subdividing pointsis acquired by forward differencing.
 4. The method for approximating acurve of claim 1, characterized in that when the curve is an ellipticcurve, the coordinate information of the subdividing points is acquiredby affine transforming.
 5. An apparatus for approximating a curve,comprising: a number acquiring unit configured to acquire numberinformation of subdividing points for subdividing a curve needed to beapproximated based on coordinate information of control points of thecurve; a coordinate acquiring unit configured to acquire coordinateinformation of the subdividing points based on the number information ofthe subdividing points and the coordinate information of the controlpoints; and a curve approximating unit configured to connect thesubdividing points with straight lines based on the coordinateinformation of the subdividing points.
 6. The apparatus forapproximating a curve of claim 5, characterized in that the numberacquiring unit comprises: a curve function acquiring unit configured toacquire a curve function of the curve based on the coordinateinformation of the control points; a mutual relationship acquiring unitconfigured to acquire a relationship between an area difference and asubdividing step based on the curve function, wherein the areadifference is the difference between the area of a curve segmentcorresponding to the subdividing step on the curve with respect to Xcoordinate axis and the area of a line segment of two pointscorresponding to the subdividing step on the curve with respect to Xcoordinate axis; a subdividing step acquiring unit configured to acquirea subdividing step corresponding to a set area difference based on therelationship between the area difference and the subdividing step; and anumber information acquiring unit configured to acquire the numberinformation of the subdividing points using the subdividing stepcorresponding to the set area difference.
 7. The apparatus forapproximating a curve of claim 5, characterized in that in the case thatthe curve is a Bezier curve, the coordinate acquiring unit acquires thecoordinate information of the subdividing points by forwarddifferencing.
 8. The apparatus for approximating a curve of claim 5,characterized in that in the case that the curve is an elliptic curve,the coordinate acquiring unit acquires the coordinate information of thesubdividing points by affine transforming.
 9. A graphic display controlmethod, comprising the steps of: acquiring number information ofsubdividing points for subdividing a curve needed to be rendered basedon coordinate information of control points of the curve; acquiringcoordinate information of the subdividing points based on the numberinformation of the subdividing points and the coordinate information ofthe control points; and connecting the subdividing points with straightlines based on the coordinate information of the subdividing points anddrawing the straight lines connecting the subdividing points accordingto rendering parameters.
 10. The graphic display control method of claim9, characterized in that the process of acquiring the number informationof the subdividing points comprises the sub-steps of: acquiring a curvefunction of the curve based on the coordinate information of the controlpoints; acquiring a relationship between an area difference and asubdividing step based on the curve function, wherein the areadifference is the difference between the area of a curve segmentcorresponding to the subdividing step on the curve with respect to Xcoordinate axis and the area of a line segment of two pointscorresponding to the subdividing step on the curve with respect to Xcoordinate axis; acquiring a subdividing step corresponding to a setarea difference based on the relationship between the area differenceand the subdividing step; and acquiring the number information of thesubdividing points using the subdividing step corresponding to the setarea difference.
 11. A graphic display control apparatus comprising: anumber acquiring unit configured to acquire number information ofsubdividing points for subdividing a curve needed to be rendered basedon coordinate information of control points of the curve; a coordinateacquiring unit configured to acquire coordinate information of thesubdividing points based on the number information of the subdividingpoints and the coordinate information of the control points; and a curverendering unit configured to connect the subdividing points withstraight lines based on the coordinate information of the subdividingpoints and draw the straight lines connecting the subdividing pointsaccording to rendering parameters.
 12. The graphic display controlapparatus of claim 11, characterized in that the number acquiring unitcomprises: a curve function acquiring unit configured to acquire a curvefunction of the curve based on the coordinate information of the controlpoints; a mutual relationship acquiring unit configured to acquire arelationship between an area difference and a subdividing step based onthe curve function, wherein the area difference is the differencebetween the area of a curve segment corresponding to the subdividingstep on the curve with respect to X coordinate axis and the area of aline segment of two points corresponding to the subdividing step on thecurve with respect to X coordinate axis; a subdividing step acquiringunit configured to acquire a subdividing step corresponding to a setarea difference based on the relationship between the area differenceand the subdividing step; and a number information acquiring unitconfigured to acquire the number information of the subdividing pointsusing the subdividing step corresponding to the set area difference.